function changes = countSiteCopyNumChanges(tree, copyNumbers, site)
%UNTITLED4 Summary of this function goes here
%   Detailed explanation goes here
[mat, id, dists] = getmatrix(tree);

maxCN = max(copyNumbers(:, site));
changes = zeros(maxCN + 1, maxCN + 1);
distIdx = 0;
for i = 1:size(mat, 2)
    for j = 1:size(mat, 1)
        if (mat(j, i) == 1)
           distIdx = distIdx + 1;
           %fprintf('connection between %d and %d\n', i, j);
           from = copyNumbers(j, site) + 1;
           to = copyNumbers(i, site) + 1;
           changes(from, to) = changes(from, to) + 1;
        end
    end
end


end

